<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Courses</title>
</head>
<body>
    <h1>Courses</h1>
    <ul>
        {% for course in courses %}
        <li>
            {{ course.CourseName }} - Capacity: {{ course.CourseCapacity }}
            <form action="{{ url_for('enroll_course', course_id=course.CourseID) }}" method="post" style="display:inline;">
                <button type="submit">Enroll</button>
            </form>
            <form action="{{ url_for('withdraw_course', course_id=course.CourseID) }}" method="post" style="display:inline;">
                <button type="submit">Withdraw</button>
            </form>
        </li>
        {% endfor %}
    </ul>
    <a href="{{ url_for('profile') }}">Back to Profile</a>
</body>
</html>
